/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.velocityme.session;

import com.velocityme.entity.ChangeDelta;
import com.velocityme.entity.Contactable;
import com.velocityme.entity.Node;
import com.velocityme.entity.Person;
import com.velocityme.utility.DurationRemaining;
import com.velocityme.utility.SearchEntry;
import java.io.File;
import java.io.InputStream;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.ejb.Local;

/**
 *
 * @author rcrida
 */
@Local
public interface NodeLocal {

    enum SummaryTables {TASK, TYPE, STATE, MONTH, WEEK, DAY, ENTRIES};

    Node createNode(KeyLocal key, Node node);

    void editNode(KeyLocal key, Node node);

    void logCreate(final Node node, ChangeDelta changeDelta);

    void logEdit(final Node node, final Node current, ChangeDelta changeDelta);

    Node findNode(KeyLocal key, Long nodeId);

    Map<String,Object> searchTimeLogValue(KeyLocal key, Node node, Collection<Contactable> contactables, boolean recursive, Set<SummaryTables> summaries, Date start, Date stop);

    Map<String,Object> searchTimeLogFilteredValue(KeyLocal key, Node node, Collection<Node> excludedNodes, Collection<Contactable> contactables, boolean recursive, Set<SummaryTables> summaries, Date start, Date stop);

    SearchEntry getHistory(KeyLocal key, Node node);

    void postComment(KeyLocal key, Long nodeId, String message, File file, String contentType, InputStream stream);

    Node deleteNode(KeyLocal key, Long nodeId);

    Map<String,DurationRemaining> searchDurationSum(KeyLocal key, Node node, boolean includeDuration, boolean recursive, Date start, Date stop, boolean singleBin);

    List<ChangeDelta> getChangeDeltas(KeyLocal key, Node node);

    List<Node> getLinkedNodes(KeyLocal key, Node node);

    Map<String,DurationRemaining> searchUnplannedSum(KeyLocal key, Collection<Person> persons, boolean recursive, Date start, Date stop, boolean singleBin);

}
